package SingleTon;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:38917
 * Date:2025/4/13
 * Time:18:31
 */
public class Hungry {
    private static final Hungry hungry = new Hungry();
    private Hungry() {}
    public static Hungry getHungry() {
        return hungry;
    }
    //
    public static void main(String[] args) {
        Hungry hungry1 = Hungry.getHungry();
        Hungry hungry2 = Hungry.getHungry();
        //true
        System.out.println(hungry1.equals(hungry2));
    }
}
